pp108 : Passing the Parameters of BusObject Class

Passing the Parameters of BusObject Class

This topic describes the process by which the parameters of the BusObject class are passed in WS-AppServer.


WS-AppServer supports passing objects of theBusObjectclass orBusObjectIteratorclass as parameters, apart from passing the basic data types.

Method Implementation

The following is a sample implementation of a method that accepts an object as a parameter.

<implementation type="BsfJavaCall">
    <class>ITEM</class>
    <method scope="out">insertItemObject</method>
    <parameters>
        <itemObj dt="java:ITEM"/>
    </parameters>
</implementation>


Note: The dt (data type) attribute in this element indicates that the InsertItemObject method expects a single ITEM object. If you want to pass a collection of objects, then change the attribute to use the
BusObjectIterator class instead of
BusObject. For example, <itemObj dt='java:ITEM[].

Sample Java Code


This example shows the java code used to pass an object.

public static void insertItemObject(ITEM itemObj)
{
	//The business logic
	itemObj.insert();
}

Sample SOAP Request

This example shows a SOAP request in which an object is passed as a parameter.

<SOAP:Envelopexmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
 <SOAP:Body>
  <insertItemObject xmlns="http://BSFDeployement">
   <itemObj>
    <tuple>
     <old>
      <ITEM>
        <CODE>89</CODE>
        <NAME>SAM</NAME>
        <DESCRIPTION>object as argument</DESCRIPTION> 
      </ITEM>
     </old>
    </tuple>
   </itemObj>
  </insertItemObject>
 </SOAP:Body>
</SOAP:Envelope>

Related concepts

BusObjects

Related reference

Mapping of BusObjects in WS-AppServer
Structure of a BusObject
States of a BusObject
Retrieving Information about a Class
Returning the Objects of BusObject Class